package model

import (
	"hass.tree.com/bridge/dbhelper"
)

type User struct {
	ID       string `gorm:"column:id;parimary_key" json:"id"`
	Username string `gorm:"column:username" json:"username"`
	Password string `gorm:"column:password" json:"password"`
	TrueName string `gorm:"column:trueName" json:"trueName"`
}

func FindByUsername(username string) User {
	var user User
	dbhelper.Db.Where("username = ?", username).Find(&user)
	return user
}
